<%@page import="rjeutsky.ControllerWrapper"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<%
	pageContext.setAttribute("publications", rjeutsky.ControllerWrapper
			.getApplicationController().getPublications());
%>
<body>
	<table>
		<tr>
			<td><jsp:include page="Menu.jsp" /></td>
			<td><span class="info">${param.infoText}</span>
			<form action="${pageContext.request.contextPath}/NewSubscription" method="post">
			<table>
					<tr>
						<th></th>
						<th>Название</th>
						<th>Цена</th>
						<th></th>
					</tr>
					<c:forEach var="publication" items="${publications}">
						<tr>
							<td><input type="checkbox" name="publicationId_${publication.id}" value="true" /></td>
							<td>${publication.name}</td>
							<td>${publication.price}</td>
							<td><a
								href="${pageContext.request.contextPath}/EditPublication.jsp?id=${publication.id }">Редактировать</a></td>
						</tr>
					</c:forEach>
				</table>
				<span class="validationError">${param.subscriptionValidation}</span>
				<input type="submit" name="submit" value="Подписаться" />
				</form>
				<span>Создать Издание</span><span class="validationError">${param.validationError}</span>
				<form action="${pageContext.request.contextPath}/NewPublication" method="POST">
					<fieldset>
						<label>Название</label><input type="text" name="name" />
					</fieldset>
					<fieldset>
						<label>Цена</label><input type="text" name="price" />
					</fieldset>
					<input type="submit" name="submit" value="Создать Издание" />
				</form></td>
		</tr>
	</table>
</body>
</html>